/**
 * 
 */
package controller;
import dataTypes.*;

/**
 * Class containing file, part number and host.
 * @author Jakub Skierbiszewski
 *
 */
public class ControllerFile
{
	public enum ControllerFilesState
	{
		/** File is waiting for host information from model */
		WAITING_FOR_HOST,
		/** File is waiting for next lacking part number from controller */
		WAITING_FOR_PART,
		/** Set containing file, part number and host is being processed by NC. Waiting for reply from NC */
		DOWNLOADING,
		/** File part is downloaded and saved by model */
		DOWNLOADED
	}
	
	private ControllerFilesState state;
	private File file;
	private Host host;
	private int partNumber;
	
	/**
	 * Creates file with partnumber
	 * @param file File descriptor
	 * @param partNumber number of part
	 */
	public ControllerFile(File file, int partNumber)
	{
		super();
		this.file = file;
		this.partNumber = partNumber;
	}
	
	/**
	 * 
	 * @return file curent state
	 */
	public ControllerFilesState getState()
	{
		return state;
	}

	/**
	 * 
	 * @return file descriptor (see also dataTypes package)
	 */
	public File getFile()
	{
		return file;
	}

	/**
	 * 
	 * @return hosst descriptor. (See also dataTypes package)
	 */
	public Host getHost()
	{
		return host;
	}

	/**
	 * 
	 * @return part number
	 */
	public int getPartNumber()
	{
		return partNumber;
	}

	
	protected void setState(ControllerFilesState state)
	{
		this.state = state;
	}

	protected void setFile(File file)
	{
		this.file = file;
	}

	protected void setHost(Host host)
	{
		this.host = host;
	}

	protected void setPartNumber(int partNumber)
	{
		this.partNumber = partNumber;
	}
	
}
